#ifndef QINSTRUMENT_H
#define QINSTRUMENT_H


#include <QSplitter>
#include "QtRendersetting.h"
#include "QtFormulaBar.h"



class QtInstrument : public QSplitter
{
	Q_OBJECT
	
public:
	//add data parameter
	QtInstrument(QtStraStrategyInfo* barinfo, BarSeries* pBarSer, BarData* pData, QWidget *parent = 0);

	~QtInstrument();

	QSize sizeHint() const;

	void MdUpdate(BarData* pData);

protected:
	//void paintEvent(QPaintEvent *event);
	void resizeEvent(QResizeEvent *event);
	void keyPressEvent(QKeyEvent *event);
	void mousePressEvent(QMouseEvent *event);
	void mouseMoveEvent(QMouseEvent *event);
	void mouseReleaseEvent(QMouseEvent *event);

private:

	void Zoom(zoomset option);
	void Scroll(int dx);

	void CreateContextMenu();


	void CreateMainbar(QtStraStrategyInfo* barinfo);

	void CreateBusicoord(BarSeries* pBarSer, BarData* pData);

	void DestroyBusicoord();

private slots:

	void OnContextMenu_Bar();

private:

	////Bars
	////QVector<BarData>*  m_pDatas;

	//BarData* m_pData;


	BusiCoord* m_pBusiCoord;


	QtFormulaBar* m_pmainbar;


	QtFormulaBar* m_pform_bar;
	QAction* m_pformbar_action;




};



#endif
